import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from './components/Home.vue'
import Index from './pages/Index.vue'
import Classify from './pages/Classify.vue'
import Test from './pages/Test.vue'
import Shopping from './pages/Shopping.vue'
import My from './pages/My.vue'
import Login from './pages/Login.vue'
import Recommend from './pages/ClassifyDat/Recommend.vue'
import Optics from './pages/ClassifyDat/Optics.vue'
import Sun from './pages/ClassifyDat/Sun.vue'
import Brand from './pages/ClassifyDat/Brand.vue'
import ListBage from './pages/ListBage.vue'
import Detall from './pages/Detall.vue'


Vue.use ( VueRouter )

const routes = [
    {
        path:'/',
        component:Home,
        redirect:'/index',
        children: [
            {   path:'index',component:Index    },
            {   path:'classify',
                component:Classify ,
                redirect:'/classify/recommend',
                children: [
                    { path:'recommend',component:Recommend },
                    { path:'optics',component:Optics },
                    { path:'sun',component :Sun },
                    { path:'brand',component:Brand }
                ]
            
            },
            {   path:'test',component:Test  },
            {   path:'shopping',component:Shopping  },
            {   path:'my',component:My  }
        ]
    },
    {   path:'/login',component:Login   },
    {   path:'/listbage',component:ListBage },
    {   path:'/detall',component:Detall }
    

]
const router = new VueRouter({routes,mode:'history'})

export default  router